import request from '@/utils/request'

// 列表
export const orderPageList = (data) => {
  return request({
    url: '/scm-orders/page-list',
    method: 'post',
    data
  })
}

// 下载
export const orderDownloadBargain = (id,bargainId,downloadMode) => {
  return request({
    url: `/scm-orders/downloadBargain/${id}?bargainId=${bargainId}&downloadMode=${downloadMode}`,
    method: 'post',
    responseType: 'blob'
  })
}

// 删除
export const orderDel = (id) => {
  return request({
    url: `/scm-orders/delete/${id}`,
    method: 'post'
  })
}

// OTC导入
export const orderImportOtc = (data) => {
  return request({
    url: '/scm-orders-otc/importOtc',
    method: 'post',
    data
  })
}

// 采购需求列表
export const ordersApprovePageList = (data) => {
  return request({
    url: '/scm-orders/approve-page-list',
    method: 'post',
    data
  })
}

// 通过
export const ordersApprovePass = (ids) => {
  return request({
    url: `/scm-orders/approvePass?idList=${ids}`,
    method: 'post'
  })
}

// 驳回
export const ordersApproveReject = (ids) => {
  return request({
    url: `/scm-orders/approveReject?idList=${ids}`,
    method: 'post'
  })
}

// 生成入库单
export const ordersInStoreApply = (data) => {
  return request({
    url: '/scm-orders/inStoreApply',
    method: 'post',
    data
  })
}

// 编辑
export const ordersModify = (data) => {
  return request({
    url: '/scm-orders/modify',
    method: 'post',
    data
  })
}

// 申请详情
export const wmsStoreApplyBatchNumberList = (id) => {
  return request({
    url: `/wms-store-apply/batchNumberList/${id}`,
    method: 'post'
  })
}

// 导出
export const scmOrdersExportExcel = (data) => {
  return request({
    url: `/scm-orders/exportExcel`,
    method: 'post',
    responseType: 'blob',
    data
  })
}

// 生成采购收货单
export const scmOrdersGeneralGoodsReceivedNote = (id) => {
  return request({
    url: `/scm-orders/generalGoodsReceivedNote/${id}`,
    method: 'post',
    responseType: 'blob'
  })
}

export const accBuyStatementCount = (parmas) => {
  return request({
    url: `/acc/buyStatementCount?ids=${parmas}`,
    method: 'get'
  })
}


export const accAccountDownloadImage = (data) => {
  return request({
    url: '/acc_account/downloadImage',
    method: 'post',
    data,
    responseType: 'blob'
  })
}



